<template>
  <div>
    <el-select v-model="val" :disabled="disabled" clearable multiple placeholder="请选择" size="mini" @change="onChange">
      <el-option
        v-for="en in options"
        :key="en._id"
        :label="en.name"
        :value="en._id"
      />
    </el-select>
  </div>
</template>

<script>
export default {
  name: 'MultipleSelect',
  props: {
    options: {
      type: Array,
      default: function() {
        return []
      }
    },
    value: {
      type: Array,
      default: function() {
        return []
      }
    },
    disabled: {
      type: Boolean,
      default: false
    }
  },
  data() {
    return {
      val: this.value
    }
  },
  methods: {
    onChange() {
      this.$emit('input', this.val)
    }
  }
}
</script>
